import React, { Component } from 'react'
import { Input } from 'antd'
import { useDispatch, useSelector } from 'react-redux';
import Grid from '@mui/material/Grid2';
import './Filter.css'
import { putFilters } from '../redux/reducers';

function Filter(props) {
  const dispatch = useDispatch()
  const jobName = useSelector(state => state.job.filters.jobName)

  const onPressEnter = (e) => {
    dispatch(putFilters({ jobName: e.target.value }))
  }

  return (
    <Grid container spacing={2}>
      <Grid size={2}>
        <div className="filter-label" style={{textAlign: 'right', marginRight: '10px'}}>职位：</div>
      </Grid>
      <Grid size={10}>
        <Input placeholder="请输入关键字" onPressEnter={ onPressEnter }/>
      </Grid>
    </Grid>
  )
}




export default Filter